package top.chenfu.aop;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @Author: romantic_ke@163.com
 * @Description:
 * @Date: 2019/8/11 21:39
 */
@Component
@Aspect
@Order(1)
public class Aop1 {

    @Pointcut("@annotation(top.chenfu.annotation.Aop1Annotation)")
    private void pt() {
    }

    @Before(value = "pt()")
    public void before() {
        System.out.println(this.getClass().getName() + "before......");
    }

    //    top.chenfu.OrdinaryPerson
    @After(value = "execution(* top.chenfu.OrdinaryPerson.*(..))")
    public void after() {
        System.out.println(this.getClass().getName() + "after......");
    }
}
